home *** CD-ROM | disk | FTP | other *** search
- /* creattem.c --- p 491 */
- #include <stdio.h>
- #include <dos.h>
- #include <io.h>
- extern unsigned char _osmajor;
- main()
- {
- int handle;
- char dirname[60];
- if(_osmajor <3)
- {
- printf("'creattemp' needs DOS version 3.0 or higher\n");
- exit(0);
- }
- printf("Enter name of directory where the "
- "temporary file will be created: ");
- gets(dirname);
- /* Call 'creattemp' to create the file. Mode 0 means
- * a normal file. */
- if((handle = creattemp(dirname, 0)) == -1)
- perror("Error in creattemp")_;
- else
- printf("Temporary file %s created.\nRemember to delete.\n",
- dirname);
- }